def good_number(num):
    s = str(num)[::-1]
    for i in range(0, len(s)):
        # 奇数位出现偶数 or 偶数位出现奇数  说明不是好数，返回False
        if (i % 2 == 0 and int(s[i]) % 2 == 0) or (i % 2 == 1 and int(s[i]) % 2 == 1):
            return False
    return True
    # return False if (i % 2 == 0 and int(s[i]) % 2 == 0) or (i % 2 == 1 and int(s[i]) % 2 == 1) else True


if __name__ == '__main__':
    res = 0
    n = int(input())
    for i in range(1, n + 1):
        if good_number(i):
            res += 1
    print(res)
